home *** CD-ROM | disk | FTP | other *** search
-
- DOS and DONT'S -- Part 23
- =========================
-
- by Jimmy Weiler
-
-
-
-
- Closing a RELative file is as
-
- simple as closing any other kind of
-
- file -- CLOSE <file number>. In our
-
- case, this would be: CLOSE 3.
-
- The 1541 disk drive has an area of
-
- 'buffer memory' where it stores PRINT#
-
- information until it has enough to
-
- write onto the disk. This usually
-
- means that the last few things you
-
- sent to your file are still sitting in
-
- memory waiting to be written. If your
-
- program ends suddenly, you lose that
-
- data. The way to force the data onto
-
- the disk is to CLOSE your file.
-
- When you close your file is up to
-
- you. Some programs CLOSE only when
-
- the user selects the QUIT option --
-
- this results in faster disk access,
-
- but if the user STOPs or RESTOREs
-
- during the program, something could
-
- be lost. Other programs CLOSE after
-
- every PRINT# to disk. This virtually
-
- guarantees that no data will be lost,
-
- but it takes extra time to CLOSE and
-
- OPEN the file every transatction.
-
- The scheme you use depends on what is
-
- more costly to you - a little data
-
- lost or slow disk access.
-
-
- Next month you can look forward to
-
- the READ and WRITE statements when
-
- working with RELative files.
-
-
- ---------- End of Article ------------
-